<h1>My Resources</h1>
<table class="table table-striped">
  <thead>
    <tr>
      <th>Name</th>
      <th>Owner</th>
      <th>Created at</th>
      <th>Actions</th>
    </tr>
  </thead>
  <tbody>
<% @resources.each do |resource| %>
      <tr>
        <% if resource.user_id == current_user.id %>
            <td><%= link_to resource.name, resource %></td>
                <td><%= link_to resource.user.name, resource_path(resource) %></td>
            <td><%= resource.updated_at.to_s(:slash_time) %></td>
            <td><%= link_to resource.file_name, resource.file.url if resource.file? %></td>
        <td>
            <%= link_to 'Edit', edit_resource_path(resource), :class => 'btn btn-mini' %>
          <%= link_to 'Delete', resource_path(resource), :method => :delete, :confirm => 'Are you sure?', :class => 'btn btn-mini btn-danger' %>
        </td>
         <%end%>
      </tr>
<% end %>
  </tbody>
</table>
